﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using NewsPub;

public partial class Site1 : System.Web.UI.MasterPage
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void Repeater2_ItemDataBound(object sender, RepeaterItemEventArgs e)
    {
        Repeater dlproduct = (Repeater)e.Item.FindControl("Repeater3");
        //DataRowView rowv = (DataRowView)e.Item.DataItem;
        Classis rowv = (Classis)e.Item.DataItem;
        int CategoryId = Convert.ToInt32(rowv["ID"]);
        Classis classis = new Classis();
        dlproduct.DataSource = Classis.FindAllByParent(CategoryId);
        dlproduct.DataBind();
        //DataProvider dp = new DataProvider();
        //string sql = "select * from news_category where upperid=" + CategoryId + " order by orderno";
        //dlproduct.DataSource = dp.GetTable(sql);
        //dlproduct.DataBind();
    }
    protected string DateNow()
    {
        string[] week = new string[] { "星期日 ", "星期一 ", "星期二 ", "星期三 ", "星期四 ", "星期五 ", "星期六 " };
        string datetime = DateTime.Now.Date.ToString("yyyy年MM月dd日") + week[(int)DateTime.Now.DayOfWeek].ToString(); 
        return datetime;
    }
}
